package com.x.example.toolbar.items;

import android.content.Context;
import android.view.Gravity;
import android.widget.FrameLayout;
import android.widget.ImageView;

import androidx.annotation.NonNull;

import com.x.example.R;
import com.example.uiframework.utils.Utils;
import com.x.uikit.toolbar.XToolbarItem;

public class CollectItem extends XToolbarItem {
    ImageView mIvIcon;

    public CollectItem(@NonNull Context context, @NonNull String token) {
        super(context, token);
        mIvIcon = new ImageView(getContext());
        mIvIcon.setImageResource(R.drawable.collect);
        mIvIcon.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
        FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(Utils.res.dpI(28), Utils.res.dpI(28));
        lp.gravity = Gravity.CENTER_VERTICAL;
        this.addView(mIvIcon, lp);
    }
}
